Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Duplicate code</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Duplicate_code"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Duplicate_code rootpage-Duplicate_code skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Duplicate code</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>In <a href="Computer_programming" title="Computer programming">computer programming</a>, <b>duplicate code</b> is a sequence of <a href="Source_code" title="Source code">source code</a> that occurs more than once, either within a program or across different programs owned or maintained by the same entity. Duplicate code is generally considered <a href="Code_smell" title="Code smell">undesirable</a> for a number of reasons.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> A minimum requirement is usually applied to the quantity of code that must appear in a sequence for it to be considered duplicate rather than coincidentally similar. Sequences of duplicate code are sometimes known as code clones or just clones, the automated process of finding duplications in source code is called clone detection.
</p><p>Two code sequences may be duplicates of each other without being character-for-character identical, for example by being character-for-character identical only when white space characters and comments are ignored, or by being <a href="Token_(parser)" class="mw-redirect" title="Token (parser)">token-for-token</a> identical, or token-for-token identical with occasional variation. Even code sequences that are only functionally identical may be considered duplicate code.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Emergence">Emergence</h2></div>
<p>Some of the ways in which duplicate code may be created are:
</p>
<ul><li><a href="Copy_and_paste_programming" class="mw-redirect" title="Copy and paste programming">copy and paste programming</a>, which in academic settings may be done as part of <a href="Plagiarism" title="Plagiarism">plagiarism</a></li></ul>
<ul><li>scrounging, in which a section of code is copied "because it works". In most cases this operation involves slight modifications in the cloned code, such as renaming variables or inserting/deleting code. The language nearly always allows one to call one copy of the code from different places, so that it can serve multiple purposes, but instead the programmer creates another copy, perhaps because they
<ul><li>do not understand the language properly</li>
<li>do not have the time to do it properly, or</li>
<li>do not care about the increased <a href="Software_rot" title="Software rot">active software rot</a>.</li></ul></li></ul>
<p>It may also happen that functionality is required that is very similar to that in another part of a program, and a developer independently writes code that is very similar to what exists elsewhere. Studies suggest that such independently rewritten code is typically not syntactically similar.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p><p>Automatically generated code, where having duplicate code may be desired to increase speed or ease of development, is another reason for duplication. Note that the actual generator will not contain duplicates in its source code, only the output it produces.
</p>
<div class="mw-heading mw-heading2"><h2 id="Fixing">Fixing</h2></div>
<p>Duplicate code is most commonly fixed by moving the code into its own unit (<a href="Function_(computer_programming)" title="Function (computer programming)">function</a> or module) and calling that unit from all of the places where it was originally used. Using a more open-source style of development, in which components are in centralized locations, may also help with duplication.
</p>
<div class="mw-heading mw-heading2"><h2 id="Costs_and_benefits">Costs and benefits</h2></div>
<p>Code which includes duplicate functionality is more difficult to support because,
</p>
<ul><li>it is simply longer, and</li>
<li>if it needs updating, there is a danger that one copy of the code will be updated without further checking for the presence of other instances of the same code.</li></ul>
<p>On the other hand, if one copy of the code is being used for different purposes, and it is not properly documented, there is a danger that it will be updated for one purpose, but this update will not be required or appropriate to its other purposes.
</p><p>These considerations are not relevant for automatically generated code, if there is just one copy of the functionality in the source code.
</p><p>In the past, when memory space was more limited, duplicate code had the additional disadvantage of taking up more space, but nowadays this is unlikely to be an issue.
</p><p>When code with a <a href="Vulnerability_(computing)" class="mw-redirect" title="Vulnerability (computing)">software vulnerability</a> is copied, the vulnerability may continue to exist in the copied code if the developer is not aware of such copies.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>
<a href="Code_refactoring" title="Code refactoring">Refactoring</a> duplicate code can improve many software metrics, such as <a href="Lines_of_code" class="mw-redirect" title="Lines of code">lines of code</a>, <a href="Cyclomatic_complexity" title="Cyclomatic complexity">cyclomatic complexity</a>, and <a href="Coupling_(computer_programming)" title="Coupling (computer programming)">coupling</a>. This may lead to shorter compilation times, lower <a href="Cognitive_load" title="Cognitive load">cognitive load</a>, less <a href="Human_error" title="Human error">human error</a>, and fewer forgotten or overlooked pieces of code. However, not all code duplication can be refactored.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
Clones may be the most effective solution if the <a href="Programming_language" title="Programming language">programming language</a> provides inadequate or overly complex abstractions, particularly if supported with user interface techniques such as <a href="Simultaneous_editing" title="Simultaneous editing">simultaneous editing</a>. Furthermore, the risks of breaking code when refactoring may outweigh any maintenance benefits.
<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
A study by Wagner, Abdulkhaleq, and Kaya concluded that while additional work must be done to keep duplicates in sync, if the programmers involved are aware of the duplicate code there weren't significantly more faults caused than in unduplicated code.
<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Detecting_duplicate_code">Detecting duplicate code</h2></div>
<p>A number of different algorithms have been proposed to detect duplicate code. For example:
</p>
<ul><li><a href="Brenda_Baker" title="Brenda Baker">Baker</a>'s algorithm.<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup></li>
<li><a href="Rabin%E2%80%93Karp_string_search_algorithm" class="mw-redirect" title="Rabin–Karp string search algorithm">Rabin–Karp string search algorithm</a>.</li>
<li>Using <a href="Abstract_syntax_tree" title="Abstract syntax tree">abstract syntax trees</a>.<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup></li>
<li>Visual clone detection.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup></li>
<li>Count matrix clone detection.<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup></li>
<li><a href="Locality-sensitive_hashing" title="Locality-sensitive hashing">Locality-sensitive hashing</a></li>
<li><a href="Anti-unification_(computer_science)" class="mw-redirect" title="Anti-unification (computer science)">Anti-unification</a><sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Example_of_functionally_duplicate_code">Example of functionally duplicate code</h2></div>
<p>Consider the following <a href="Snippet_(programming)" title="Snippet (programming)">code snippet</a> for calculating the <a href="Average" title="Average">average</a> of an <a href="Array_data_structure" class="mw-redirect" title="Array data structure">array</a> of <a href="Integer" title="Integer">integers</a>
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span class="k">extern</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">array_a</span><span class="p">[];</span>
<span class="k">extern</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">array_b</span><span class="p">[];</span>
<span class="w"> </span>
<span class="kt">int</span><span class="w"> </span><span class="n">sum_a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>

<span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">4</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span>
<span class="w"> </span><span class="n">sum_a</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">array_a</span><span class="p">[</span><span class="n">i</span><span class="p">];</span>

<span class="kt">int</span><span class="w"> </span><span class="n">average_a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">sum_a</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="mi">4</span><span class="p">;</span>
<span class="w"> </span>
<span class="kt">int</span><span class="w"> </span><span class="n">sum_b</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>

<span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">4</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span>
<span class="w"> </span><span class="n">sum_b</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">array_b</span><span class="p">[</span><span class="n">i</span><span class="p">];</span>

<span class="kt">int</span><span class="w"> </span><span class="n">average_b</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">sum_b</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="mi">4</span><span class="p">;</span>
</pre></div>
<p>The two loops can be rewritten as the single function:
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span class="kt">int</span><span class="w"> </span><span class="nf">calc_average_of_four</span><span class="p">(</span><span class="kt">int</span><span class="o">*</span><span class="w"> </span><span class="n">array</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">sum</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">4</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span>
<span class="w"> </span><span class="n">sum</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">array</span><span class="p">[</span><span class="n">i</span><span class="p">];</span>

<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">sum</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="mi">4</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
<p>or, usually preferably, by parameterising the number of elements in the array.
</p><p>Using the above function will give source code that has no loop duplication:
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span class="k">extern</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">array1</span><span class="p">[];</span>
<span class="k">extern</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">array2</span><span class="p">[];</span>

<span class="kt">int</span><span class="w"> </span><span class="n">average1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">calc_average_of_four</span><span class="p">(</span><span class="n">array1</span><span class="p">);</span>
<span class="kt">int</span><span class="w"> </span><span class="n">average2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">calc_average_of_four</span><span class="p">(</span><span class="n">array2</span><span class="p">);</span>
</pre></div>
<p>Note that in this trivial case, the <a href="Compiler" title="Compiler">compiler</a> may choose to <a href="Inline_expansion" title="Inline expansion">inline</a> both calls to the function, such that the resulting <a href="Machine_code" title="Machine code">machine code</a> is identical for both the duplicated and non-duplicated examples above. If the function is not inlined, then the <a href="Subroutine" class="mw-redirect" title="Subroutine">additional overhead of the function calls</a> will probably take longer to run (on the order of 10 processor instructions for most high-performance languages). Theoretically, this additional time to run could matter.
</p>

<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Abstraction_principle_(programming)" class="mw-redirect" title="Abstraction principle (programming)">Abstraction principle (programming)</a></li>
<li><a href="Anti-pattern" title="Anti-pattern">Anti-pattern</a></li>
<li><a href="Data_deduplication" title="Data deduplication">Data deduplication</a></li>
<li><a href="Don't_repeat_yourself" title="Don't repeat yourself">Don't repeat yourself</a> (DRY)</li>
<li><a href="List_of_tools_for_static_code_analysis" title="List of tools for static code analysis">List of tools for static code analysis</a></li>
<li><a href="Redundant_code" title="Redundant code">Redundant code</a></li>
<li><a href="Rule_of_three_(computer_programming)" title="Rule of three (computer programming)">Rule of three (computer programming)</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap mw-references-columns"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFSpinellis" class="citation web cs1">Spinellis, Diomidis. <a rel="nofollow" class="external text" href="http://www.informit.com/articles/article.aspx?p=457502&amp;seqNum=5">"The Bad Code Spotter's Guide"</a>. InformIT.com<span class="reference-accessdate">. Retrieved <span class="nowrap">2008-06-06</span></span>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://www.cqse.eu/publications/2010-code-similarities-beyond-copy-paste.pdf">Code similarities beyond copy &amp; paste</a> by Elmar Juergens, Florian Deissenboeck, Benjamin Hummel.</span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite id="CITEREFLiKwonKwonLee2016" class="citation journal cs1">Li, Hongzhe; Kwon, Hyuckmin; Kwon, Jonghoon; Lee, Heejo (25 April 2016). "CLORIFI: software vulnerability discovery using code clone verification". <i>Concurrency and Computation: Practice and Experience</i>. <b>28</b> (6): <span class="nowrap">1900–</span>1917. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1002%2Fcpe.3532">10.1002/cpe.3532</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:17363758">17363758</a>.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite id="CITEREFArcelli_FontanaZanoniRanchettiRanchetti2013" class="citation journal cs1">Arcelli Fontana, Francesca; Zanoni, Marco; Ranchetti, Andrea; Ranchetti, Davide (2013). <a rel="nofollow" class="external text" href="https://boa.unimib.it/bitstream/10281/42633/1/clone.pdf">"Software Clone Detection and Refactoring"</a> <span class="cs1-format">(PDF)</span>. <i>ISRN Software Engineering</i>. <b>2013</b>: <span class="nowrap">1–</span>8. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1155%2F2013%2F129437">10.1155/2013/129437</a></span>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text">Kapser, C.; Godfrey, M.W., <a rel="nofollow" class="external text" href="http://plg2.cs.uwaterloo.ca/~migod/papers/2006/wcre06-clonePatterns.pdf">""Cloning Considered Harmful" Considered Harmful</a>," 13th Working Conference on Reverse Engineering (WCRE), pp. 19-28, Oct. 2006</span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite id="CITEREFWagnerAbdulkhaleqKayaPaar2016" class="citation book cs1">Wagner, Stefan; Abdulkhaleq, Asim; Kaya, Kamer; Paar, Alexander (2016). <a rel="nofollow" class="external text" href="http://elib.uni-stuttgart.de/opus/volltexte/2016/10526/">"On the Relationship of Inconsistent Software Clones and Faults: An Empirical Study"</a>. <i>2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER)</i>. pp.&nbsp;<span class="nowrap">79–</span>89. <a href="ArXiv_(identifier)" class="mw-redirect" title="ArXiv (identifier)">arXiv</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://arxiv.org/abs/1611.08005">1611.08005</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2FSANER.2016.94">10.1109/SANER.2016.94</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1-5090-1855-0</bdi>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&nbsp;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:3154845">3154845</a>.</cite></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><a href="Brenda_Baker" title="Brenda Baker">Brenda S. Baker</a>. <i>A Program for Identifying Duplicated Code.</i> Computing Science and Statistics,
24:49–57, 1992.</span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text">Ira D. Baxter, et al. <a rel="nofollow" class="external text" href="http://www.semanticdesigns.com/Company/Publications/ICSM98.pdf">Clone Detection Using Abstract Syntax Trees</a></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.iam.unibe.ch/~scg/Archive/Papers/Rieg98aEcoopWorkshop.pdf">Visual Detection of Duplicated Code</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20060629083352/http://www.iam.unibe.ch/~scg/Archive/Papers/Rieg98aEcoopWorkshop.pdf">Archived</a> 2006-06-29 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a> by Matthias Rieger, Stephane Ducasse.</span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-10">^</a></b></span> <span class="reference-text">Yuan, Y. and Guo, Y. <i>CMCD: Count Matrix Based Code Clone Detection,</i> in 2011 18th Asia-Pacific Software Engineering Conference. IEEE, Dec. 2011, pp. 250–257.</span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text">Chen, X., Wang, A. Y., &amp; Tempero, E. D. (2014). <a rel="nofollow" class="external text" href="http://www.qualitascorpus.com/pubs/ChenWangTemperoClones.pdf">A Replication and Reproduction of Code Clone Detection Studies</a>. In ACSC (pp. 105-114).</span>
</li>
<li id="cite_note-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-12">^</a></b></span> <span class="reference-text">Bulychev, Peter, and Marius Minea. "<a rel="nofollow" class="external text" href="https://cyberleninka.ru/article/n/duplicate-code-detection-using-anti-unification">Duplicate code detection using anti-unification</a>." Proceedings of the Spring/Summer Young Researchers’ Colloquium on Software Engineering. No. 2. Федеральное государственное бюджетное учреждение науки Институт системного программирования Российской академии наук, 2008.</span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="https://archive.today/20121211121637/http://students.cis.uab.edu/tairasr/clones/literature/">The University of Alabama at Birmingham: Code Clones Literature</a></li>
<li><a rel="nofollow" class="external text" href="http://alexdresko.com/2010/09/09/finding-duplicate-code-in-c-vb-net-aspx-ruby-python-java-c-c-actionscript-or-xaml">Finding duplicate code in C#, VB.Net, ASPX, Ruby, Python, Java, C, C++, ActionScript, or XAML</a></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-06-29" href="https://en.wikipedia.org/wiki/?title=Duplicate_code&amp;oldid=1297979332">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>